<?
	/* Se asegura que el archivo es incluido por el index */
	defined( 'LOAD_MODULE_ACTION' ) or die( 'No esta permitido el acceso directo a ' . __FILE__ );
		$this->oTmpObject = new Salon_frm( $this );

	class Salon_frm extends Frm
	{
	function setValue ( $ncOrden, $ncEstablecimiento )
		{
			$cSql = "SELECT  ncTipoSalon,  cdSalon,  nLargo,  nAncho,  nAlto,  nSuperficie,  nqAuditorio,  nqBanquete,  nqEscuela,  nqCoctel,  nqMesaU,  nqDirectorio,  cUbicacion,  cPlano
				FROM gtSalon
				WHERE ncOrden = '$ncOrden' AND  ncEstablecimiento = '$ncEstablecimiento' ";
			$aDatos = $this->oDatabase->getArray($cSql);
			$this->setFieldsArray ( $aDatos );
		}
	function Salon_frm( &$oModule )
		{
			$this->Frm( $oModule );
			//Crea los Objetos de los campos de edicion
			$this->aFields['ncEstablecimiento']		= new Input( "Codigo Establecimiento", "ncEstablecimiento", '', false, true );
			$this->aFields['ncOrden']						= new Input( "Codigo", "ncOrden", '', false, true );
			$this->aFields['ncTipoSalon']				= new InputList( "Tipo", "ncTipoSalon" );
			$this->aFields['cdSalon']						= new InputText( "Nombre", "cdSalon" );
			$this->aFields['nLargo']						= new InputNumber( "Largo", "nLargo" );
			$this->aFields['nAncho']						= new InputNumber( "Ancho", "nAncho" );
			$this->aFields['nAlto']							= new InputNumber( "Alto", "nAlto" );
			$this->aFields['nSuperficie']					= new InputNumber( "Superficie m2", "nSuperficie" );
			$this->aFields['nqAuditorio']				= new InputNumber( "Capacidad Auditorio", "nqAuditorio" );
			$this->aFields['nqBanquete']				= new InputNumber( "Capacidad Banquete", "nqBanquete" );
			$this->aFields['nqEscuela']					= new InputNumber( "Capacidad Escuela", "nqEscuela" );
			$this->aFields['nqCoctel']					= new InputNumber( "Capacidad Coctel", "nqCoctel" );
			$this->aFields['nqMesaU']					= new InputNumber( "Capacidad Mesa en U", "nqMesaU" );
			$this->aFields['nqDirectorio']				= new InputNumber( "Capacidad Directorio", "nqDirectorio" );
			$this->aFields['cUbicacion']					= new InputText( "Ubicacion", "cUbicacion" );
			$this->aFields['cPlano']						= new InputFile( "Plano", "cPlano" );
		}
	function initializeForm()
		{
			// Si viene el Ubicacion hace el retrieve
				if ( $this->isRetrievable() && $this->aFields['ncOrden']->getValue() && $this->aFields['ncEstablecimiento']->getValue() )
				{
					$this->setValue( $this->aFields['ncOrden']->getValue(), $this->aFields['ncEstablecimiento']->getValue() );
				}
			// Configura el Titulo
				$this->setLabel( "Salon" );
			return true;
		}
	function initializeField( $cField , &$oField )
		{
			switch ( $cField )
			{
				case 'ncTipoSalon':
					$cSql = "SELECT ncTipoSalon, ncTipoSalon FROM gcTipoSalon";
					$oField->setMatrix($this->oDatabase->getMatrix($cSql));
					$oField->setMandatory($this->isMandatory);
				break;
			}
 		}
	}
?>